package com.example.javaproject.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.example.javaproject.entity.Salary;
import com.example.javaproject.dto.SalaryDTO;
import com.example.javaproject.dto.SalaryStatsDTO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface SalaryMapper extends BaseMapper<Salary> {

    
    Page<SalaryDTO> selectSalaryPage(Page<SalaryDTO> page,
                                     @Param("status") Integer status,
                                     @Param("studentName") String studentName,
                                     @Param("teacherName") String teacherName,
                                     @Param("positionName") String positionName);

    
    Page<SalaryDTO> selectTeacherSalaryPage(Page<SalaryDTO> page,
                                            @Param("teacherId") Integer teacherId,
                                            @Param("status") Integer status,
                                            @Param("studentName") String studentName,
                                            @Param("positionName") String positionName);

    /**
     * 查询学生工资分页信息
     * @param page 分页对象
     * @param studentId 学生ID
     * @return 工资分页信息
     */
    Page<SalaryDTO> selectStudentSalaryPage(Page<SalaryDTO> page, @Param("studentId") Integer studentId);

    int teacherApproveSalary(@Param("id") Integer id, @Param("teacherId") Integer teacherId);
    int teacherRejectSalary(@Param("id") Integer id, @Param("teacherId") Integer teacherId);
    int teacherResendSalary(@Param("id") Integer id, @Param("teacherId") Integer teacherId);

    List<SalaryStatsDTO> getSalaryStats();
}